home *** CD-ROM | disk | FTP | other *** search
/ The Amiga Game Guide / AmigaGameGuide_CD.iso / Amiga / Game-Installer / WHD_Installers / Games_N-R / Ruffian / Install next >
Text File  |  1977-12-31  |  3KB  |  141 lines

  1. ;****************************
  2.  
  3. (set #readme-file "README")    ;name of readme file
  4. (set #cleanup "")        ;files to delete after install
  5. (set #last-file "Disk.3")    ;last file the imager should create
  6.  
  7. ;****************************
  8. ;----------------------------
  9. ; Checks if given program is reachable via the path
  10. ; if not abort install
  11. ; IN:  #program - to check
  12. ; OUT: -
  13.  
  14. (procedure P_chkrun
  15.   (if
  16.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  17.     ("")
  18.     (abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the whdload package." #program))
  19.   )
  20. )
  21.  
  22. ;****************************
  23.  
  24. (if
  25.   (exists #readme-file)
  26.   (if 
  27.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  28.     ("")
  29.     (run ("SYS:Utilities/More %s" #readme-file))
  30.   )
  31. )
  32.  
  33. (set #program "WHDLoad")
  34. (P_chkrun)
  35.  
  36. (set #program "Patcher")
  37. (P_chkrun)
  38.  
  39. (if
  40.   (= @user-level 2)
  41.   (
  42.     (set #CI_drive
  43.       (askchoice
  44.     (prompt "Select source drive for diskimages")
  45.     (default 0)
  46.     (choices "DF0:" "DF1:" "DF2:" "DF3:")
  47.     (help @askchoice-help)
  48.       )
  49.     )
  50.     (if
  51.       (= #CI_drive 0)
  52.       (set #CI_drive "DF0:")
  53.     )
  54.     (if
  55.       (= #CI_drive 1)
  56.       (set #CI_drive "DF1:")
  57.     )
  58.     (if
  59.       (= #CI_drive 2)
  60.       (set #CI_drive "DF2:")
  61.     )
  62.     (if
  63.       (= #CI_drive 3)
  64.       (set #CI_drive "DF3:")
  65.     )
  66.   )
  67.   (
  68.     (set #CI_drive "DF0:")
  69.   )
  70. )
  71.  
  72. (set @default-dest
  73.   (askdir
  74.     (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  75.     (help @askdir-help)
  76.     (default @default-dest)
  77.     (disk)
  78.   )
  79. )
  80. (set #dest (tackon @default-dest @app-name))
  81. (if
  82.   (exists #dest)
  83.   (
  84.     (set #choice
  85.       (askbool
  86.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted ?" #dest))
  87.         (default 1)
  88.         (choices "Delete" "Skip")
  89.         (help @askbool-help)
  90.       )
  91.     )
  92.     (if
  93.       (= #choice 1)
  94.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  95.     )
  96.   )
  97. )
  98. (makedir #dest
  99.   (help @makedir-help)
  100.   (infos)
  101. )
  102.  
  103. ;----------------------------
  104.  
  105. (copyfiles
  106.   (help @copyfiles-help)
  107.   (source ("%s.inf" @app-name ))
  108.   (newname ("%s.info" @app-name ))
  109.   (dest #dest)
  110. )
  111. (copyfiles
  112.   (help @copyfiles-help)
  113.   (source ("%s.slave" @app-name ))
  114.   (dest #dest)
  115. )
  116. (if
  117.   (exists #readme-file)
  118.   (copyfiles
  119.     (help @copyfiles-help)
  120.     (source #readme-file)
  121.     (dest #dest)
  122.   )
  123. )
  124.  
  125. (run ("Assign \"%s:\" \"%s\"" @app-name #dest))
  126. (run ("Patcher -p%s.imager -s%s" @app-name #CI_drive))
  127. (run ("Assign \"%s:\" Remove" @app-name))
  128.  
  129. (if
  130.   (exists (tackon #dest #last-file))
  131.   ("")
  132.   (abort "Diskimaging not successful !\nThe Patcher could'nt create all needed files !")
  133. )
  134.  
  135. ;----------------------------
  136.  
  137. (run ("Delete %s ALL QUIET FORCE" #cleanup))    ;delete temporary files
  138.  
  139. (exit)
  140.  
  141.